﻿#include "CGeneralJsonStringRet.h"



CGeneralJsonStringRet::CGeneralJsonStringRet(uint32_t uid, uint32_t pn)
	: BaseMessage(uid, pn)
{
	_safe_guard_begin;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
CGeneralJsonStringRet::~CGeneralJsonStringRet(void)
{
}

void CGeneralJsonStringRet::SetJsonData(const char* key, uint32_t val)
{
	_safe_guard_begin;

	m_jv[key] = val;

	_safe_guard_end;
}

void CGeneralJsonStringRet::SetJsonData(const char* key, int32_t val)
{
	_safe_guard_begin;

	m_jv[key] = val;

	_safe_guard_end;
}

void CGeneralJsonStringRet::SetJsonData(const char* key, uint16_t val)
{
	_safe_guard_begin;

	m_jv[key] = val;

	_safe_guard_end;
}

void CGeneralJsonStringRet::SetJsonData(const char* key, int16_t val)
{
	_safe_guard_begin;

	m_jv[key] = val;

	_safe_guard_end;
}

void CGeneralJsonStringRet::SetJsonData(const char* key, const char* val)
{
	_safe_guard_begin;

	m_jv[key] = val;

	_safe_guard_end;
}

void CGeneralJsonStringRet::SetJsonData(const char* key, double val)
{
	_safe_guard_begin;

	m_jv[key] = val;

	_safe_guard_end;
}

void CGeneralJsonStringRet::SetJsonData(const char* key, Json::Value val)
{
	_safe_guard_begin;

	m_jv[key] = val;

	_safe_guard_end;
}

//void CGeneralJsonStringRet::SetJsonData(const char * key, std::wstring val)
//{
//	_safe_guard_begin;
//
//	m_jv[key] = val.c_str();
//
//	_safe_guard_end;
//}

void CGeneralJsonStringRet::SetJsonData(const char* key, const wchar_t* val)
{
	_safe_guard_begin;

	char cStr[256];
	memcpy(cStr, &val, sizeof(cStr));

	m_jv[key] = cStr;

	//m_jv[key] = val;

	_safe_guard_end;
}

void CGeneralJsonStringRet::Clear()
{
	_safe_guard_begin;

	m_jv.clear();

	_safe_guard_end;
}

void CGeneralJsonStringRet::SetProtocolNumber(uint32_t pn)
{
	_safe_guard_begin;

	ResetProtocolNumber(pn);

	_safe_guard_end;
	
}
